#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Time    : 2021/7/28 4:26 下午
# @Author  : WangZhixing

from ..PrintFormat.ColorPrint import BluePrint, GreenPrint


def DataSetInfo(dataset):
    BluePrint(f'Dataset: {dataset}:')
    BluePrint('======================')
    BluePrint(f'Number of graphs: {len(dataset)}')
    BluePrint(f'Number of features: {dataset.num_features}')
    BluePrint(f'Number of classes: {dataset.num_classes}')

def DataInfo(data):
    GreenPrint('======================')
    # Gather some statistics about the graph.
    GreenPrint(f'Number of nodes: {data.num_nodes}')
    GreenPrint(f'Number of edges: {data.num_edges}')
    # GreenPrint(f'Number of cluster: {len(data.y)}')
    GreenPrint(f'Average node degree: {data.num_edges / data.num_nodes:.2f}')
    GreenPrint(f'Number of training nodes: {data.train_mask.sum()}')
    GreenPrint(f'Training node label rate: {int(data.train_mask.sum()) / data.num_nodes:.2f}')
    if "contains_self_loops" in dir(data):
        GreenPrint(f'Contains isolated nodes: {data.contains_isolated_nodes()}')
        GreenPrint(f'Contains self-loops: {data.contains_self_loops()}')
    else:
        GreenPrint(f'Contains isolated nodes: {data.has_isolated_nodes()}')
        GreenPrint(f'Contains self-loops: {data.has_self_loops()}')
    GreenPrint(f'Is undirected: {data.is_undirected()}')
    GreenPrint(f'Data\'s dimension: {data.x.shape[1]}')
